/*
 Copyright To change this template, choose Tools | Templates
 Copyright and open the template in the editor.
 */

package com.click.app.dao.hibernate;

import com.click.app.dao.LaundryStorageDao;
import com.click.app.model.LaundryStorage;
import java.util.List;

/**
 * @author Joel Chuca Condo
 * @date 17/06/2009
 */
public class LaundryStorageDaoHibernate extends GenericDaoHibernate<LaundryStorage, Long> implements LaundryStorageDao{

    public LaundryStorageDaoHibernate(){
        super(LaundryStorage.class);
    }
    
   public LaundryStorage findByPantDesignAndTradeMark(Long idPantDesign, Long idTrademark){
        List<LaundryStorage> lista = getHibernateTemplate().find("from LaundryStorage where pantDesign.id="+idPantDesign+" AND tradeMark.id="+idTrademark );
        if(lista.size()==1){
            return lista.get(0);
        }else{
            return null;
        }
    }
}
